###################################################################### Product:      KnowledgeEngine (Plone Edition)## File:         __init__.py## Copyright:    Copyright (c) 2004, Faulkner Technologies## Author:       Brian Oliver## Description:  Initialises Sub-Package Reports#####################################################################

####################################################################### Knowledge Engine Library Imports# (none - done automatically. see below)

####################################################################### Zope Library Importsfrom App.FindHomes import ppath

####################################################################### Python Library Importsimport os

#####################################################################
## Python Logging Configuration
import logging
log = logging.getLogger("KnowledgeEngine.Startup")
    #####################################################################    ## Import the KnowledgeEngine Reports#### Each KnowledgeEngine Report type resides in an independant package## (named after the report type) within the Reports folder## in the KnowledgeEngine Zope Product#### By individually importing each Report type, they have a chance of## performing their own initialisation, including appropriately## registering themselves as part of the KnowledgeEngine product.

# The path to the KnowledgeEngine Report PackagesREPORTS_PATH = ppath[0] + os.sep + "KnowledgeEngine" + os.sep + "Reports"

# Dynamically import each of the defined Report packages in the REPORTS_PATHfor report in [file for file in os.listdir(REPORTS_PATH) if os.path.isdir(REPORTS_PATH + os.sep + file)]:

    # Import the current report (if it doesn't contain a .)    if report.find(".") < 0:        log.info("Registering Report: " + report)            exec "from Products.KnowledgeEngine.Reports." + report + " import *"
        
#####################################################################    
